package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.DatElectricmeterMapper;
import com.rzl.expense.expense.domain.DatElectricmeter;
import com.rzl.expense.expense.service.IDatElectricmeterService;

/**
 * 电信息Service业务层处理
 * 
 * @author expense
 * @date 2025-02-20
 */
@Service
public class DatElectricmeterServiceImpl implements IDatElectricmeterService 
{
    @Autowired
    private DatElectricmeterMapper datElectricmeterMapper;

    /**
     * 查询电信息
     * 
     * @param meterId 电信息主键
     * @return 电信息
     */
    @Override
    public DatElectricmeter selectDatElectricmeterByMeterId(String meterId)
    {
        return datElectricmeterMapper.selectDatElectricmeterByMeterId(meterId);
    }

    /**
     * 查询电信息列表
     * 
     * @param datElectricmeter 电信息
     * @return 电信息
     */
    @Override
    public List<DatElectricmeter> selectDatElectricmeterList(DatElectricmeter datElectricmeter)
    {
        return datElectricmeterMapper.selectDatElectricmeterList(datElectricmeter);
    }

    /**
     * 新增电信息
     * 
     * @param datElectricmeter 电信息
     * @return 结果
     */
    @Override
    public int insertDatElectricmeter(DatElectricmeter datElectricmeter)
    {
        datElectricmeter.setCreateTime(DateUtils.getNowDate());
        return datElectricmeterMapper.insertDatElectricmeter(datElectricmeter);
    }

    /**
     * 修改电信息
     * 
     * @param datElectricmeter 电信息
     * @return 结果
     */
    @Override
    public int updateDatElectricmeter(DatElectricmeter datElectricmeter)
    {
        datElectricmeter.setUpdateTime(DateUtils.getNowDate());
        return datElectricmeterMapper.updateDatElectricmeter(datElectricmeter);
    }

    /**
     * 批量删除电信息
     * 
     * @param meterIds 需要删除的电信息主键
     * @return 结果
     */
    @Override
    public int deleteDatElectricmeterByMeterIds(String[] meterIds)
    {
        return datElectricmeterMapper.deleteDatElectricmeterByMeterIds(meterIds);
    }

    /**
     * 删除电信息信息
     * 
     * @param meterId 电信息主键
     * @return 结果
     */
    @Override
    public int deleteDatElectricmeter(String[] currentDate)
    {
        return datElectricmeterMapper.deleteDatElectricmeter(currentDate[0],currentDate[1]);
    }




    @Override
    public void batchDatElectricmeter(List<DatElectricmeter> list)
    {

         datElectricmeterMapper.batchDatElectricmeter(list);
    }


}
